package com.haoshuang.zhouzhoubang.ui.page.shop.confirm

import com.chad.library.adapter4.BaseQuickAdapter
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemShopingGoodsIncludeBinding
import com.haoshuang.zhouzhoubang.model.bean.OrderShopBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.load


/**
 * 订单模块中的订单列表适配器
 * */
class ShopAdapter(data: MutableList<OrderShopBean.CartInfo>) :
    BaseBindingQuickAdapter<OrderShopBean.CartInfo, ItemShopingGoodsIncludeBinding>(data){

    override fun onBindViewHolder(
        holder: BaseBindingHolder,
        position: Int,
        item: OrderShopBean.CartInfo?
    ) {
        val binding = ItemShopingGoodsIncludeBinding.bind(holder.itemView)
        binding.apply {
            ivOrderGoodsImage.load(item?.image, R.mipmap.default_image)
            tvOrderGoodsName.text=item?.store_name
            tvOrderGoodsPrice.text="¥"+item?.price
            tvSpec.text = "${item?.select_spec}  X${item?.cart_num}"

        }
    }

}